SET( CMAKE_CXX_COMPILER "/opt/intel/bin/icpc" )
cmake_minimum_required(VERSION 2.8)

project(ParaToSPHARM)

  find_package(ITK REQUIRED)
  if(ITK_FOUND)
    include(${USE_ITK_FILE})
  else(ITK_FOUND)
    message(FATAL_ERROR, "ITK not found. Please set ITK_DIR.")
  endif(ITK_FOUND)

  find_package(VTK REQUIRED)
  if(VTK_FOUND)
    include(${USE_VTK_FILE})
  else(VTK_FOUND)
    message(FATAL_ERROR, "VTK not found. Please set VTK_DIR.")
  endif(VTK_FOUND)

  find_package(CLAPACK REQUIRED)
  if(CLAPACK_FOUND)
    set(LAPACK_LIBRARIES lapack blas) 
  else(CLAPACK_FOUND)
    message(FATAL_ERROR, "CLAPACK not found. Please set CLAPACK_DIR.")
  endif(CLAPACK_FOUND)

#LINK_DIRECTORIES(/usr/local/cula/lib64)

set(ParaToSPHARM_SOURCE ParaToSPHARM.cxx itkMeshTovtkPolyData.cxx vtkPolyDataToitkMesh.cxx SphericalHarmonicSpatialObject.cxx SphericalHarmonicCoefficientFileReader.cxx SphericalHarmonicMeshSource.cxx ParametricMeshToSPHARMSpatialObjectFilter.cxx SphericalHarmonicCoefficientFileWriter.cxx)

add_executable(ParaToSPHARM ${ParaToSPHARM_SOURCE})

target_link_libraries( ParaToSPHARM
       ${ITK_LIBRARIES}
       vtkIO vtkHybrid vtkCommon vtkFiltering lapack #cula_lapack cublas cudart cula_core     
       )
